package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum ScopeEnum {

	COMPANY(1L, "公司"),
	SITE(2L, "站点"),
	SUPPLIER(3L, "供应商"),
	USER(4L, "用户"),
	PURCHASE(5L, "采购组"),
	CUSTOMER(6L, "客户"),
	WAREHOUSE(7L, "仓库");
	/**
	 * id
	 */
	private Long id;

	/**
	 * 描述
	 */
	private String description;

	public static ScopeEnum get(Long id){
		if (Objects.isNull(id)) {
			return null;
		}
		for (ScopeEnum scopeEnum : ScopeEnum.values()){
			if (id.equals(scopeEnum.id))  return scopeEnum;
		}
		return null;
	}
}
